﻿using Lightworks.Core.Entity;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Lightworks.System.Models
{
    [SugarTable("sys_user")]
    public class User : BaseEntity
    {
        [Required]
        [SugarColumn(ColumnName = "user_name")]
        public string? UserName { get; set; }
        [Required]
        public string? Name { get; set; } 
        public string? Gender { get; set; }
        public string? Password { get; set; }
        public string? Avatar { get; set; }
        public string? Salt { get; set; }
        public long DeptId { get; set; }
        public bool IsSuper { get; set; }
        public string? Status { get; set; }
        [Navigate(NavigateType.OneToOne, nameof(DeptId))]
        public Department? Dept { get; set; }
        [Navigate(typeof(UserRole), nameof(UserRole.UserId), nameof(UserRole.RoleId))]
        public List<Role>? Roles { get;set;  }
    }
}
